using System.Windows.Forms;

namespace Toolbox.Model
{
    /// <summary>
    /// 页签页面抽象基类
    /// 为所有页签页面提供统一的初始化和高度调整通知方法
    /// </summary>
    public abstract class BaseTabPage
    {
        /// <summary>
        /// 页签名称
        /// </summary>
        public abstract string TabName { get; }
        
        /// <summary>
        /// 配置文件名称（不含路径和扩展名）
        /// </summary>
        public abstract string ConfigFileName { get; }
        
        /// <summary>
        /// 页签序号（用于排序）
        /// </summary>
        public abstract int TabOrder { get; }
        
        /// <summary>
        /// 初始化页签页面
        /// </summary>
        /// <param name="tabPage">页签控件</param>
        /// <param name="mainForm">主窗口引用</param>
        public abstract void InitializePage(TabPage tabPage, MainForm mainForm);

        /// <summary>
        /// 处理窗口高度变化的通知
        /// 默认实现为空
        /// </summary>
        /// <param name="tabPage">页签控件</param>
        /// <param name="mainForm">主窗口引用</param>
        /// <param name="currentHeight">当前窗口高度</param>
        public virtual void OnWindowHeightChanged(TabPage tabPage, MainForm mainForm, int currentHeight) { }

        /// <summary>
        /// 停止运行并释放资源
        /// 默认实现为空
        /// </summary>
        /// <param name="mainForm">主窗口引用</param>
        public virtual void StopRunning(MainForm mainForm) { }
        
        /// <summary>
        /// 处理页签切换事件
        /// 默认实现为空
        /// </summary>
        /// <param name="mainForm">主窗口引用</param>
        public virtual void OnTabSelected(MainForm mainForm) { }
    }
}